<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center renovation_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub renovation_fd0_0'>
          <view class='flex flex-wrap align-center renovation_fd0_0_c0' @tap.stop="handle">
            <text class='fu-iconfont2  renovation_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='renovation_fd0_0_c1_c0'>二维码</text>
          </view>
          <view class='flex flex-wrap align-center justify-end renovation_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---搜索记录flex布局开始-->

      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searh_flex_1" v-if="isshow">
        <view style="display: flex;justify-content: center;" >
          <image :src="imageUrl" mode="aspectFit" style="width: 600rpx;height: 600rpx;margin-top: 70rpx;"></image>
        </view>
				<view style="display: flex;flex-wrap: wrap;font-size: 30rpx;padding-left: 24rpx;padding-right: 24rpx;margin-top: 20rpx;" >
				  <text>1.该二维码可用于扫码入场，每刷一次次数减一。</text>				
					<text style="margin-top: 10rpx;">2.在非您预约的时段扫码，不可进入。</text>	
					<text style="margin-top: 10rpx;">3.二维码扫码次数，取决于预约时添写的数量。</text>
					
					<!-- <text style="margin-top: 10rpx;">5.每次进入该页面，生成的二维码都具有唯一性，闸机扫码之后都会扣除相应次数。</text> -->
				</view>
      </view>
			
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searh_flex_1" v-else>
        <view style="display: flex;justify-content: center;" >
          <image src='../../../static/images/order.png' mode="aspectFit" style="width: 550rpx;height: 550rpx;margin-top: 70rpx;"></image>		
        </view>
				<view style="display: flex;justify-content: center;">
					<text style="color: #999999;">暂无数据</text>
				</view>
				
      </view>
 


    </view>
  </view>
</template>
<script>

  export default {
    data() {
      return {
        dataList:'',
				imageUrl: '',
				isshow:undefined,
				orderID:''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
		 this.orderID=options.id
     this.getqrCode()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      handle() {
        uni.navigateBack()
      },
			qrcode() {
				//let id=uni.getStorageSync('userId')
				let id=1
				uni.request({
					url: `http://192.168.1.31:8024/primary/member/qrcode/${this.orderID}`,
					method: 'GET',
					success: (res) => {    
						this.imageUrl = 'data:image/jpeg;base64,' +  res.data.msg
					},
					fail: (err) => {
						console.error('请求失败:', err);
					}
				});
			},
			//获取二维码
			async getqrCode() {
				uni.showLoading({
					title:'加载中'
				})
				//let id=uni.getStorageSync('userId')
				let requestUrl = `${global.apiUrls.paysucces}/${this.orderID}`;
				let res = await this.$api.get(requestUrl);
				uni.hideLoading()
				if (res.data.code != 200) {
					this.$message.info(res.data.msg);
					this.isshow=false
					return
				}
						
				if(res.data.data){
					this.imageUrl = 'data:image/jpeg;base64,' + res.data.data.orderCodeBase64
					this.isshow=true
				}else{
					this.isshow=false
				}
			},
    }
  };
</script>
<style lang="scss" scoped>
  .search-wrap {
    width: 400rpx;
    height: 67rpx;
    background: #F9F9F9;
    border-radius: 10rpx;
    padding: 0 24rpx;
    display: flex;
    align-items: center;

    image {
      width: 28rpx;
      height: 28rpx;
      margin-right: 17rpx;
    }
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .renovation_flex_0 {
    background: var(--benbenbgColor1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .renovation_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333333;
    line-height: 88rpx;
  }

  .renovation_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .renovation_fd0_0_c0 {
    width: 120rpx;
  }

  .renovation_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .uni-input-input {
    width: 400rpx !important;
  }

  .informationDelivery_fd1_1 {
    margin: 32rpx 0rpx 72rpx 0rpx;
    width: 680rpx;
  }

  .jinGangDetail_bodyItemfd1_0_c3_c0_c0_c0_c0 {
    color: rgba(40, 118, 255, 1);
    font-size: 26rpx;
    font-weight: 400;
  }

  .jinGangDetail_bodyItemfd1_0_c3_c0_c0_c0 {
    background: rgba(233, 241, 255, 1);
    height: 64rpx;
    //width: 146rpx;
    background-size: 100% auto;
    border-radius: 36rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
    padding: 0 28rpx;
  }

  .jinGangDetail_bodyItemfd1_0_c3_c0_c1_c0_c0 {
    color: #333;
    font-size: 26rpx;
    font-weight: 400;
  }

  .jinGangDetail_bodyItemfd1_0_c3_c0_c1_c0 {
    background: rgba(246, 247, 249, 1);
    height: 64rpx;
    //width: 146rpx;
    background-size: 100% auto;
    border-radius: 36rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
    padding: 0 28rpx;
  }

  .searh_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 90rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .searh_fd0_0_c2_c0 {
    color: rgba(255, 255, 255, 1);
    font-size: 28rpx;
    font-weight: 500;
    line-height: 40rpx;
    margin: 0rpx 0rpx 0rpx 6rpx;
  }

  .searh_fd0_0_c2 {
    background: rgba(1, 50, 189, 1);
    margin: 0rpx 0rpx 6rpx 24rpx;
    width: 120rpx;
    height: 68rpx;
    background-size: 100% auto;
    border-radius: 36rpx;
  }

  .searh_fd0_0_c1_c1 {
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
  }

  .search_fd3_0_c1 {
    background: rgba(254, 243, 235, 1);
    margin: 0rpx 0rpx 0rpx auto;
    padding: 8rpx 16rpx 8rpx 16rpx;
    border-radius: 38rpx;
    color: rgba(240, 102, 0, 1);
    font-size: 24rpx;
    font-weight: 400;
    background-size: 100% auto;
  }

  .u-input {
    justify-content: center !important;
    align-items: center !important;

  }

  .searh_fd0_0_c1_c0 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 10rpx 0rpx 0rpx;
  }

  .searchInfo_fd0_0_c1_c2 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .searh_fd0_0_c1 {
    background: #F9F9F9;
    height: 64rpx;
    border-radius: 34rpx 34rpx 34rpx 34rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
    margin: 0rpx 0rpx 0rpx 0rpx;
    display: flex;
    align-items: center;
    align-items: center;

  }

  .searh_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
  }

  .search_fd0_0_c1 {
    width: 40rpx;
    height: 40rpx;
  }

  .searh_fd0_0 {
    padding: 0rpx 24rpx 0rpx 24rpx;
    line-height: 88rpx;
  }

  .searh_flex_1 {
    padding: 0rpx 0rpx 0rpx 0rpx;
  }

  .searh_fd1_1_c1 {
    font-size: 24rpx;
    font-weight: 400;
    color: #666666;
    margin: 0rpx 0rpx 32rpx 24rpx;
  }

  .searh_fd1_1_c0_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .searh_fd1_1_c0 {
    background: rgba(248, 248, 248, 1);
    border-radius: 32rpx 32rpx 32rpx 32rpx;
    background-size: 100% auto !important;
    padding: 0rpx 0rpx 0rpx 0rpx;
    line-height: 56rpx;
    margin: 0rpx 32rpx 24rpx 0rpx;
  }

  .searh_fd1_1 {
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .searh_fd1_0_c1 {
    width: 24rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .searh_fd1_0_c0 {
    font-size: 32rpx;
    font-weight: 600;
    color: rgba(51, 51, 51, 1);
  }

  .searh_fd1_0 {
    padding: 32rpx 0rpx 24rpx 0rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .searh_flex_2 {
    background: #fff;
    margin: 0rpx 105rpx 0rpx 105rpx;
    background-size: #eee;
    border-radius: 25rpx 25rpx 25rpx 25rpx;
    padding: 40rpx 0rpx 0rpx 0rpx;
  }

  .searh_fd2_1_c1 {
    background: transparent;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 16rpx 0rpx;
    font-size: 32rpx;
    color: #f16c0a;
    width: 269rpx;
    height: 110rpx;
  }

  .searh_fd2_1_c0 {
    border-right: 1px solid #EEEEEE;
    background: transparent;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 0rpx 16rpx;
    font-size: 32rpx;
    color: rgba(153, 153, 153, 1);
    height: 110rpx;
    width: 270rpx;
  }

  .searh_fd2_1 {
    border-top: 1px solid #eee;
  }

  .searh_fd2_0 {
    font-size: 36rpx;
    font-weight: 500;
    line-height: 52rpx;
    color: #333333;
    margin: 40rpx 0rpx 80rpx 0rpx;
  }

  .searh_flex_3 {
    margin: 48rpx 0rpx 0rpx 0rpx;
  }

  .searh_fd3_1_c0_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
  }

  .searh_fd3_1_c0 {
    background: rgba(248, 248, 248, 1);
    border-radius: 32rpx 32rpx 32rpx 32rpx;
    background-size: 100% auto !important;
    padding: 0rpx 24rpx 0rpx 24rpx;
    line-height: 56rpx;
    margin: 24rpx 32rpx 24rpx 0rpx;
  }

  .searh_fd3_1 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .searh_fd3_0_c0 {
    font-size: 32rpx;
    font-weight: 700;
    color: rgba(51, 51, 51, 1);
  }

  .searh_fd3_0 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }
</style>